﻿<cfsilent>
	<cfscript>

		event.setArg("pageTitle", "课程成绩");
		
		currentTab = event.getArg("TabID", "labWelcome");
		
		sessionAdvice = getProperty("serviceFactory").getBean("sessionAdvice");
		dictAdvice = getProperty("serviceFactory").getBean("senateDictionaryAdvice");
		datetimeAdvice = getProperty("serviceFactory").getBean("datetimeAdvice");
		markAdvice = getProperty("serviceFactory").getBean("markAdvice");
		
		/* 学籍相关信息 */
		studentId = event.getArg("STU");
		
		/* 学期相关信息 */
		termId = event.getArg("TermID");
		
		/*学生信息*/
		/*学生信息*/
		sql = "SELECT a.stu_id,a.stu_name,a.stu_name_english,a.stu_sex, a.nationality,a.STU_BIRTHDAY, a.grad_date, 
      			  b.hsk_score, b.date_join, b.st_id 
				FROM t_student a 
				INNER JOIN t_student_status b ON b.stu_id = a.stu_id 
				WHERE a.stu_id = :studentId";
		
		queryObj = new Query( datasource=application.dnsSlave );
		
		queryObj.addParam( name="studentId", value=studentId, cfsqltype="cf_sql_varchar" );

		rs_student = queryObj.execute( sql=sql ).getResult();
		 
		 /*本科生学分统计*/ 
		 if( rs_student.st_id eq '8' or rs_student.st_id eq '83'){
			 
				dateJoin = "";
		
				tipDate = "";
				
				/*如果没有入学时间，那么把入学时间设为第一个班级的时间*/	
				if( rs_student.date_join eq ''){
					
					sql = "select grade from (select grade from t_class where cls_id in (select cls_id from i_stu_class_info a where a.stu_id = :studentId ) order by grade ) where rownum = 1";	
					queryObj = new Query( datasource=application.dnsSlave );
				
					queryObj.addParam( name="studentId", value=studentId, cfsqltype="cf_sql_varchar" );
			
					rs_class = queryObj.execute( sql=sql ).getResult();
					
					if( rs_class.recordCount gt 0){
						
						if( right(rs_class.grade,1) eq '1' ){
							dateJoin = left(rs_class.grade,4) & "0901";
						}else{
							dateJoin = (left(rs_class.grade,4)+1) & "0301";
						}
						
						tipDate = dateJoin;
					}
		
					
				}else{
					dateJoin = replace(rs_student.date_join,'-','','ALL');
					dateJoin = replace(dateJoin,',','','ALL');
					dateJoin = replace(dateJoin,'.','','ALL');
				}
				
				stuYear = "0";
				
				/*根据入学时间判断学生类型和免修课程*/
				if( left(dateJoin,6) < 200808 ){
					stuYear = "2005";	
				}else if( left(dateJoin,6) < 201208 ){
					stuYear = "2008";	
				}else if( left(dateJoin,6) < 201308 ){
					stuYear = "2012";	
				}else if( left(dateJoin,6) >= 201308 ){
					stuYear = "2013";	
				}
				
				/*成绩信息*/
				sql = "SELECT 
							a.mark_mode,a.mark_result,a.mark_note,a.mark_resit,a.mark_renote,a.mark_resit_limit,
							a.credit, a.credit_point, a.credit_point_o, a.exam_module, a.cid , 
							a.prop_id,a.term_id, 
							b.course_code,b.course_name,
							(SELECT t.name FROM t_course_type s INNER JOIN t_course_type_dict t ON t.id = s.course_dict
							 WHERE (s.course_code = b.course_code OR b.course_name like s.course_name || '%' ) AND s.year = :year AND rownum=1
							) course_type ,
							(SELECT t.rank FROM t_course_type s INNER JOIN t_course_type_dict t ON t.id = s.course_dict
							 WHERE (s.course_code = b.course_code OR b.course_name like s.course_name || '%' ) AND s.year = :year AND rownum=1
							) course_rank 
						 FROM t_student_mark a 
						 INNER JOIN t_course b ON b.cid = a.cid 
						 WHERE a.stu_id = :studentId 
							AND ( (a.mark_note = '1' AND (a.mark_result > 0 or a.mark_result = 0)) OR (a.mark_renote = '1' AND (a.mark_resit > 0 or a.mark_resit = 0))  )
						 ORDER BY course_rank, prop_id, course_code ";
						 
				queryObj = new Query( datasource=application.dnsSlave );
				
				queryObj.addParam( name="studentId", value=studentId, cfsqltype="cf_sql_varchar" );
				queryObj.addParam( name="year", value=stuYear, cfsqltype="cf_sql_char" );
		
				rs_studentMark = queryObj.execute( sql=sql ).getResult();
				
				
				cids = "";
				courseNames = "";
				num = 0;
				for( i=1; i LE rs_studentMark.recordCount ;i++){
					
					if( rs_studentMark["credit"][i] neq '0'){
						
						cids = cids & rs_studentMark["cid"][i] & ",";
						courseNames = courseNames & rs_studentMark["course_name"][i] & ",";
						
					}
					
				}
					
				
				rs_hskMark = queryNew("");
				
				
			    yearTerm = left(dateJoin,6);
			    
			    yearMouth = "";
			    
			    if(yearTerm lt 200808){
				    yearMouth = '200508';
			    }else if(yearTerm lt 201208){
				    yearMouth = '200808';
			    }else if(yearTerm lt 201308){
				    yearMouth = '201208';
			    }else{
				    yearMouth = '201308';
			    }
			    
			    /*HSK免修成绩信息*/
			    sql = "SELECT a.course_name, a.course_code, a.cid, a.credit, a.course_credit, b.prop_id ,  
						    (SELECT t.name FROM t_course_type s INNER JOIN t_course_type_dict t ON t.id = s.course_dict
							WHERE (s.course_code = a.course_code or b.course_name like s.course_name || '%') AND s.year = :year and rownum=1 
						    ) course_type ,
						    (SELECT t.rank FROM t_course_type s INNER JOIN t_course_type_dict t ON t.id = s.course_dict
							WHERE (s.course_code = b.course_code OR b.course_name like s.course_name || '%' ) AND s.year = :year AND rownum=1
						    ) course_rank 
					  FROM t_hsk_course a 
					  INNER JOIN t_course b ON b.cid = a.cid 
					  WHERE a.hsk = :hskScore 
						   AND 
						   a.year_term = :yearMouth 
						   AND a.course_name NOT IN (:names) 
						   AND a.cid NOT IN (:cids) 
					  ORDER BY 
						  course_rank, b.prop_id, a.course_code";
			    
			    queryObj = new Query( datasource=application.dnsSlave );
			    
			    queryObj.addParam( name="hskScore", value=rs_student.hsk_score, cfsqltype="cf_sql_varchar" );
			    queryObj.addParam( name="yearMouth", value=yearMouth, cfsqltype="cf_sql_varchar" );
			    queryObj.addParam( name="names", value=courseNames, cfsqltype="cf_sql_varchar", list=true );
			    queryObj.addParam( name="cids", value=cids, cfsqltype="cf_sql_varchar", list=true );
			    queryObj.addParam( name="year", value=stuYear, cfsqltype="cf_sql_char");
			    
			    rs_hskMark = queryObj.execute( sql=sql ).getResult();
	    
				
				courseCredit = 0; //总学分
				courseMust = 0; //必修课学分
				courseSelect = 0; //选修课学分
				
				creditPoint = 0;  //课程学分绩点
				creditAvgpt = 0; //平均学分绩点
				
				for( i=1; i LE rs_studentMark.recordCount ;i++){
					
					credit = rs_studentMark["credit"][i];
						
					 /*对‘汉语阅读’按年级进行单独计算学分*/
					 
					 if( credit neq 0 ){
						 
						 /*又松大学一律按2004级计划*/
						 if( (stuYear eq '2008' and rs_student.st_id neq '83') or stuYear eq '2012' ){
							 if( (rs_studentMark["course_name"][i] eq '汉语阅读-1') or (rs_studentMark["course_name"][i] eq '汉语阅读-2') or (rs_studentMark["course_name"][i] eq '汉语阅读-3')){
								 credit = 4;
							 }
						 }else{
							 if( rs_studentMark["course_name"][i] eq '汉语阅读-1' ){
								 credit = 3;
							 }else if( (rs_studentMark["course_name"][i] eq '汉语阅读-2') OR (rs_studentMark["course_name"][i] eq '汉语阅读-3')){
								 credit = 2;
							 }
						 }
						 
					 }
					 
					 if( rs_studentMark["prop_id"][i] eq '1'){
						
						courseMust = courseMust + credit;
					}else{
						courseSelect = courseSelect + credit;
					}
					 
					creditPoint =creditPoint + credit * rs_studentMark["credit_point"][i];
					courseCredit = courseCredit + credit;
				}
				
				/*又松大学不免修*/
				if ( rs_student.st_id neq '83'){
					
					for( i=1; i LE rs_hskMark.recordCount ;i++){
						creditPoint =creditPoint + rs_hskMark["course_credit"][i] * rs_hskMark["credit"][i];
						courseCredit = courseCredit + rs_hskMark["course_credit"][i];
						
						if( rs_hskMark["prop_id"][i] eq '1'){
							courseMust = courseMust + rs_hskMark["course_credit"][i];
						}else{
							courseSelect = courseSelect + rs_hskMark["course_credit"][i];
						}
					}
					
				}
				
				if( courseCredit neq 0){
					creditAvgpt = creditPoint/courseCredit;
				}
				
				
		 }

			
		/* 学生各项学分统计（普通学生<非本科生>） */
		sql = "SELECT 
					a.credit, a.credit_req, a.credit_opt, a.credit_phy, a.credit_com, 
					a.credit_failure, 
					a.credit_grad, 
					a.credit_req_avgpt, 
					a.credit_avgpt, 
					a.credit_grad_avgpt 
					FROM t_student_profile a 
					WHERE 
						a.stu_id = :studentId ";
		
		queryObj = new Query( datasource=application.dnsSlave );
		queryObj.addParam( name="studentId", value=studentId, cfsqltype="cf_sql_varchar" );

		rs_summary = queryObj.execute( sql=sql ).getResult();
		

		/* 计划课程 */
		sql = "SELECT 
				t_student_mark.cid ,
				t_term.term_id, t_term.academic_year, t_term.academic_term, 
				t_course.cid, t_course.course_code, t_course.course_name, t_student_mark.credit course_credit, 
				t_student_mark.retaking, t_student_mark.mark_mode, t_student_mark.mark_result, t_student_mark.mark_note, 
				t_student_mark.mark_resit, t_student_mark.mark_renote, t_student_mark.mark_resit_limit, 
				t_student_mark.credit_point,t_student_mark.credit_point_o, t_student_mark.credit,
				t_course_prop.prop_id, t_course_prop.prop_name 
				FROM t_student_mark 
				INNER JOIN t_term ON t_term.term_id = t_student_mark.term_id 
				INNER JOIN t_course ON t_course.cid = t_student_mark.cid 
				INNER JOIN t_course_prop ON t_course_prop.prop_id = t_student_mark.prop_id 
				WHERE 
					t_student_mark.stu_id = :studentId 
					AND 
					t_student_mark.task_type = 'P' 
				ORDER BY 
					t_term.academic_year DESC, t_term.academic_term, t_course_prop.prop_id, t_course.course_name";
		
		queryObj = new Query( datasource=application.dnsSlave );
		queryObj.addParam( name="studentId", value=studentId, cfsqltype="cf_sql_varchar" );
		
		rs_plan = queryObj.execute( sql=sql ).getResult();

		termYearArray = [];
		termArray = [];
		
		if ( rs_plan.recordCount ) { 
			
			for( j=1; j LTE rs_plan.recordCount; j++ ){
				termYear = [ rs_plan["academic_year"][j], 0 ];
				if ( not arrayFind( termYearArray, termYear ) ) {
					arrayAppend( termYearArray, termYear );
				}
			}

			i=0; 
			for ( termYear in termYearArray ) {
				i++;
				for( j=1; j LTE rs_plan.recordCount; j++ ){
					if ( rs_plan["academic_year"][j] eq termYear[1] ) {

						termYear[2] ++;
						termYearArray[i] = termYear;

					}
				}
			}

			for( j=1; j LTE rs_plan.recordCount; j++ ){
				term = [ rs_plan["academic_year"][j], rs_plan["academic_term"][j], 0, rs_plan["term_id"][j] ];
				if ( not arrayFind( termArray, term ) ) {
					arrayAppend( termArray, term );
				}
			}

			i=0;
			for ( term in termArray ) {
				i++;
				for( j=1; j LTE rs_plan.recordCount; j++ ){
					if ( rs_plan["academic_year"][j] eq term[1] and rs_plan["academic_term"][j] eq term[2] ) {
						term[3] = term[3] + 1;
						termArray[i] = term;
					}
				}
			}
			
		}
		
		
		/* 全校通选 */
		sql = "SELECT 
				t_term.term_id, t_term.academic_year, t_term.academic_term, 
				t_course.cid, t_course.course_code, t_course.course_name, t_course.course_credit, 
				t_student_mark.retaking, t_student_mark.mark_mode, t_student_mark.mark_result, t_student_mark.mark_note, 
				t_student_mark.mark_resit, t_student_mark.mark_renote, t_student_mark.mark_resit_limit, 
				t_course_prop.prop_id, t_course_prop.prop_name 
				FROM t_student_mark 
				INNER JOIN t_term ON t_term.term_id = t_student_mark.term_id 
				INNER JOIN t_course ON t_course.cid = t_student_mark.cid 
				INNER JOIN t_course_prop ON t_course_prop.prop_id = t_student_mark.prop_id 
				WHERE 
					stu_id = :studentId 
					AND 
					task_type = 'C' 
				ORDER BY 
					t_term.academic_year, t_term.academic_term, t_course_prop.prop_id, t_course.course_name";
		
		queryObj = new Query( datasource=application.dnsSlave );
		queryObj.addParam( name="studentId", value=studentId, cfsqltype="cf_sql_varchar" );
		
		rs_common = queryObj.execute( sql=sql ).getResult();

		/* 体育选项 */
		sql = "SELECT 
				t_term.term_id, t_term.academic_year, t_term.academic_term, 
				t_course.cid, t_course.course_code, t_course.course_name, t_course.course_credit, 
				t_student_mark.retaking, t_student_mark.mark_mode, t_student_mark.mark_result, t_student_mark.mark_note, 
				t_student_mark.mark_resit, t_student_mark.mark_renote, t_student_mark.mark_resit_limit, 
				t_course_prop.prop_id, t_course_prop.prop_name 
				FROM t_student_mark 
				INNER JOIN t_term ON t_term.term_id = t_student_mark.term_id 
				INNER JOIN t_course ON t_course.cid = t_student_mark.cid 
				INNER JOIN t_course_prop ON t_course_prop.prop_id = t_student_mark.prop_id 
				WHERE 
					stu_id = :studentId 
					AND 
					task_type = 'T' 
				ORDER BY 
					t_term.academic_year, t_term.academic_term, t_course_prop.prop_id, t_course.course_name";
		
		queryObj = new Query( datasource=application.dnsSlave );
		queryObj.addParam( name="studentId", value=studentId, cfsqltype="cf_sql_varchar" );
		
		rs_physical = queryObj.execute( sql=sql ).getResult();
		

		/* 以往四六级考试成绩 */
		sql = "SELECT 
				exam_id, scroll_id, absent, scroll, listening, reading, writing, integration
				FROM t_cet_scroll 
				WHERE 
					stu_id = :studentId 
				ORDER BY 
					scroll_id DESC ";
		
		queryObj = new Query( datasource=application.dnsSlave );
		queryObj.addParam( name="studentId", value=studentId, cfsqltype="cf_sql_varchar" );
		
		rs_cet = queryObj.execute( sql=sql ).getResult();
		
		
		
		/* 是否在显示成绩时, 检查评教是否完成 */
		disableMark = false;
		complateCourseIds = [];
		

		/* 网上评教相关设置 */
		evsDateStart = event.getArg("EVALSYS.STU.DateStart");
		evsDateEnd = event.getArg("EVALSYS.STU.DateEnd");
		evsDisableMarkView = yesNoFormat( event.getArg("EVALSYS.STU.DisableMarkView") );
	
		/* 当前日期 */
		dateNow = datetimeAdvice.getCurrentDateString();

		/* 是否在可评教时间 */
		if ( dateNow GTE evsDateStart AND dateNow LTE evsDateEnd ) {
			
			
			/* 全局设置了 如果未评教禁止查看成绩 并且 目前在评教期间 */
			if ( evsDisableMarkView ) {
				disableMark = true;
			}
			
			/* 刷新当前学生需要的评教数据 */
			transaction{
				
				/* 当前时间戳 */
				currentTimeStamp = datetimeAdvice.getCurrentDatetimeString();
				
				/* 追加评教状态数据 */
				sql = "INSERT INTO t_student_evaluate 
						( scc_id, state, date_create, date_lastupdate ) 
						SELECT 
						a.scc_id, 'NO' state, :ts date_create, :ts date_lastupdate 
						FROM t_student_course a 
						WHERE 
							a.term_id = :termId 
							AND 
							a.stu_id = :studentId 
							AND 
							substr(a.choose_prop, 2, 1) = '1' 
							AND 
							NOT EXISTS ( 
								SELECT 1 FROM t_student_evaluate b 
								WHERE 
									a.scc_id = b.scc_id 
							) 
							AND 
							EXISTS ( 
								SELECT 1 FROM t_course_evaluate c 
								WHERE 
									c.cid = a.cid 
							) ";
				
				queryObj = new Query( datasource=application.dnsMaster );
				queryObj.addParam( name="termId", value=termId, cfsqltype="cf_sql_char" );
				queryObj.addParam( name="studentId", value=studentId, cfsqltype="cf_sql_varchar" );
				queryObj.addParam( name="ts", value=currentTimeStamp, cfsqltype="cf_sql_char" );
	
				queryObj.execute( sql=sql ).getResult();
	
			}
			
			/* 读取已完成评教的课程数据 */
			sql = "SELECT 
						b.cid 
						FROM t_student_evaluate a 
						INNER JOIN t_student_course b ON a.scc_id = b.scc_id 
						WHERE 
							b.stu_id = :studentId 
							AND 
							b.term_id = :termId 
							AND 
							a.state = 'CP' ";
		
			queryObj = new Query( datasource=application.dnsSlave );
			queryObj.addParam( name="studentId", value=studentId, cfsqltype="cf_sql_varchar" );
			queryObj.addParam( name="termId", value=termId, cfsqltype="cf_sql_char" );
		
			rs_course_evaluate = queryObj.execute( sql=sql ).getResult();

			for ( a=1; a LTE rs_course_evaluate.recordCount; a++ ) {
				arrayAppend( complateCourseIds, rs_course_evaluate["cid"][a] );
			}

		}

		currentTab = event.getArg("TabID", "labPlan");
		
		passArgs = structNew();
		structInsert(passArgs, "Class", event.getArg("class"), true);
		structInsert(passArgs, "TabID", "labClass", true);

	</cfscript>
</cfsilent>

<div id="headArea">
	<div class="uiHeader uiHeaderWithImage ptm">
		<div class="clearfix uiHeaderTop">
			<div class="uiHeaderActions rfloat">
				<a class="uiButton" href="<cfoutput>#buildURL('studentByClass',passArgs)#</cfoutput>"><i class="mrs img btnList"></i><span class="uiButtonText">返回</span></a>
			</div>
			<div>
				<h2 class="uiHeaderTitle">
					<i class="uiHeaderImage img icon16x16 application"></i>成绩档案 - <cfoutput>#rs_student.stu_name#</cfoutput>
				</h2>
			</div>
		</div>
	</div>
</div>

<div class="UIElement">
	<ul class="senateFirstPage">
		<li>
			<div class="clearfix" id="welcome">
				
				<div class="UItab">
					<div class="tabLables">
						<span <cfif currentTab eq "labSummary">class="active"</cfif> id="labSummary" tabTarget="Summary">学分修读进度</span>
						<span <cfif currentTab eq "labPlan">class="active"</cfif> id="labPlan" tabTarget="Plan">计划课程</span>
						<!---<span <cfif currentTab eq "labCommon">class="active"</cfif> id="labCommon" tabTarget="Common">全校通选课</span>--->
						<!---<span <cfif currentTab eq "labPhysical">class="active"</cfif> id="labPhysical" tabTarget="Physical">体育项目</span>
						<span <cfif currentTab eq "labCET">class="active"</cfif> id="labCET" tabTarget="CET">外语等级考试</span>--->
					</div>
				</div>
				<script language="javascript" type="text/javascript">
					//<![CDATA[
					<!--
					$(document).ready(function() {
						
						/* init Tab */
						$("div.tabContent").hide();
						$("div#" + $("div.tabLables span.active").attr("tabTarget")).show();
						
						$("div.tabLables > span").click(function(){
							var $targetID = $(this).attr("tabTarget");
							
							$("div.tabLables span").removeClass("active");
							$(this).addClass("active");
							
							$("div.tabContent").not('[id="' + $targetID + '"]').hide();
							$("div.tabContent#" + $targetID).show();
						});
						
					});
					
					// -->
					//]]>
				</script>
				
				<div id="Summary" class="tabContent">
					
					<div class="noticeBlock">
						<h3>学分修读情况</h3>
						<p><span class="img icon16x16 message"></span>下面列出的是 <em><cfoutput>#rs_student.stu_name#</cfoutput>(<cfoutput>#rs_student.stu_id#</cfoutput>)</em> 目前修读课程所获得的各项学分统计和平均学分绩点( <font color="#CC3333">本科生包含HSK免修课程学分</font> )</p>
						<hr/>
					</div>
					
					<div class="UICircle clearfix">
						<ul class="boxNavigation">
                              	<cfif rs_student.st_id neq '8' and rs_student.st_id neq '83'>
                                   
                                             <li class="huge"><em><cfoutput>#replace( numberFormat( rs_summary.credit, "_._" ), ".0", "" )#</cfoutput></em><span>总学分</span></li>
                                             <cfif rs_summary.credit_req neq "">
                                                  <li class="large deepblue"><em><cfoutput>#replace( numberFormat( rs_summary.credit_req, "_._" ), ".0", "" )#</cfoutput></em><span>必修课</span></li>
                                             </cfif>
                                             <cfif rs_summary.credit_opt neq "">
                                                  <li class="normal green"><em><cfoutput>#replace( numberFormat( rs_summary.credit_opt, "_._" ), ".0", "" )#</cfoutput></em><span>选修课</span></li>
                                             </cfif>
                                             <cfif rs_student.hsk_score neq "">
                                                  <li class="normal"><em><cfoutput>#replace( numberFormat( rs_student.hsk_score, "_._" ), ".0", "" )#</cfoutput></em><span>HSK</span></li>
                                             </cfif>
                                        
                                        <cfelse>
                                        	
                                              <li class="huge"><em><cfoutput>#replace( numberFormat( courseCredit, "_._" ), ".0", "" )#</cfoutput></em><span>总学分</span></li>
                                             <cfif rs_summary.credit_req>
                                                  <li class="large deepblue"><em><cfoutput>#replace( numberFormat( courseMust, "_._" ), ".0", "" )#</cfoutput></em><span>必修课</span></li>
                                             </cfif>
                                             <cfif rs_summary.credit_opt>
                                                  <li class="normal green"><em><cfoutput>#replace( numberFormat( courseSelect, "_._" ), ".0", "" )#</cfoutput></em><span>选修课</span></li>
                                             </cfif>
                                             <cfif rs_student.hsk_score neq "">
                                                  <li class="normal"><em><cfoutput>#replace( numberFormat( rs_student.hsk_score, "_._" ), ".0", "" )#</cfoutput></em><span>HSK</span></li>
                                             </cfif>
                                        	
                                    </cfif>
						</ul>
					</div>
					
					<div class="UICircle clearfix">
						<ul class="boxNavigation">
                             		<cfif rs_student.st_id neq '8' and rs_student.st_id neq '83'>
									<cfif rs_summary.credit_avgpt neq "">
                                                  <li class="large red"><em><cfoutput>#numberFormat( rs_summary.credit_avgpt, "_.__" )#</cfoutput></em><span>平均学分绩点</span></li>
                                             </cfif>
                                             
                                        <cfelse>
                                        	  <li class="large red"><em><cfoutput>#numberFormat( creditAvgpt, "_.__" )#</cfoutput></em><span>平均学分绩点</span></li>
                                   </cfif>
						</ul>
					</div>
				</div>

				<div id="Plan" class="tabContent">
				
					<div class="noticeBlock">
						<h3>培养方案课程</h3>
						<p><span class="img icon16x16 message"></span>下面列出的是的是 <em><cfoutput>#rs_student.stu_name#</cfoutput>(<cfoutput>#rs_student.stu_id#</cfoutput>)</em> 在每个学年修读课程成绩及改门课程所获得的课程绩点</p>
						<hr/>
					</div>
					
					<cfif rs_plan.recordCount eq 0>
						<div class="systemNotice">
							<h3><span class="img icon16x16 info"></span>尚无历史成绩</h3>
							<p>当前还没有的是 <em><cfoutput>#rs_student.stu_name#</cfoutput>(<cfoutput>#rs_student.stu_id#</cfoutput>)</em> 修读课程的成绩信息.</p>
						</div>
					</cfif>

					<cfif arrayLen(termYearArray)>
						
						<cfloop array="#termYearArray#" index="termYear">
							<table class="UItable">
								<tr class="cellBorder">
									<td colspan="9">
										<span class="number bold"><cfoutput>#termYear[1]#</cfoutput></span> 学年
										共计 <span class="number bold"><cfoutput>#termYear[2]#</cfoutput></span> 门课程
									</td>
								</tr>
								
								<cfloop array="#termArray#" index="term">
									<cfif term[1] eq termYear[1]>
										
										<cfset termMarkCredit = 0 />
										<cfset termCredit = 0 />
										
										<cfset termMarkCreditReq = 0 />
										<cfset termCreditReq = 0 />

										<tr class="cellBorder">
											<td width="11" rowspan="<cfoutput>#(term[3] + 3)#</cfoutput>"><cfoutput>#dictAdvice.getTermName( term[2] )#</cfoutput></td>
										</tr>
										<tr class="cellBorder">
											<td>课程</td>
											<td align="center" width="80">课程号</td>
											<td align="center" width="40">学分</td>
											<td align="center" width="60">课程性质</td>
											<td align="center" width="60">正考</td>
											<td align="center" width="60">补考</td>
                                                       <td align="center" width="80">成绩绩点</td>
											<td align="center" width="80">课程学分绩点</td>
										</tr>

										<cfloop query="rs_plan">
											
											<cfif term[1] eq rs_plan.academic_year and term[2] eq rs_plan.academic_term >
											
                                                       	<cfset courseCredit = rs_plan.credit_point />
												<cfset courseMarkCredit = rs_plan.credit_point_o />
												
												<cfset termMarkCredit = termMarkCredit + courseMarkCredit />
												<cfset termCredit = termCredit + rs_plan.credit />
												
                                                            <cfif rs_plan.mark_mode eq '5' >
                                                            	<cfset finalResult = rs_plan.mark_result />
                                                                 <cfset resitResult = rs_plan.mark_resit />
                                                                 <cfif resitResult eq "0">
														<cfset resitResult = "" />
                                                                 </cfif>
                                                            <cfelse>
													<cfset finalResult = markAdvice.getMark( rs_plan.mark_mode, rs_plan.mark_result, rs_plan.mark_note ) />
                                                                 <cfset resitResult = markAdvice.getMarkResit( rs_plan.mark_mode, rs_plan.mark_resit, rs_plan.mark_renote, rs_plan.mark_resit_limit ) />
                                                             </cfif>
												
												<cfif rs_plan.prop_id eq "1">
													<cfset termMarkCreditReq = termMarkCreditReq + courseMarkCredit />
													<cfset termCreditReq = termCreditReq + rs_plan.course_credit />
												</cfif>
												
												<tr class="cellBorder <cfif rs_plan.credit eq 0>alertRow</cfif>">
													<td><cfoutput>#rs_plan.course_name#</cfoutput> <cfif rs_plan.retaking>(重新学习)</cfif></td>
													<td align="center"><span class="number"><cfoutput>#rs_plan.course_code#</cfoutput></span></td>
													<td align="center"><span class="number"><cfoutput>#numberFormat( rs_plan.course_credit, "_._" )#</cfoutput></span></td>
													<td align="center"><cfoutput>#rs_plan.prop_name#</cfoutput></td>
													
											    
													<cfif disableMark AND term[4] eq termId AND NOT arrayFind( complateCourseIds, rs_plan.cid ) >
															<!--- 需要完成评教 才能看本学期成绩 --->
															<td colspan="3" align="center">请完成评教</td>
														<cfelse>
															<td align="center"><cfif isNumeric(finalResult)><span class="number"><cfoutput>#finalResult#</cfoutput></span><cfelse><cfoutput>#finalResult#</cfoutput></cfif></td>
															<td align="center"><cfif isNumeric(resitResult)><span class="number"><cfoutput>#resitResult#</cfoutput></span><cfelse><cfoutput>#resitResult#</cfoutput></cfif></td>
                                                                           <td align="center"><cfif courseMarkCredit gt -1><span class="number"><cfoutput>#numberFormat( courseCredit, "_._")#</cfoutput></span></cfif></td>
															<td align="center"><cfif courseMarkCredit gt -1><span class="number"><cfoutput>#numberFormat( courseMarkCredit, "_._")#</cfoutput></span></cfif></td>
													</cfif>
												</tr>
											</cfif>
										</cfloop>
										
										<tr class="cellBorder">
											<td colspan="8" align="right">
												平均学分绩点 <span class="number bold"><cfif termCredit gt 0><cfoutput>#numberFormat( termMarkCredit/termCredit, "_.__")#</cfoutput><cfelse>-/-</cfif></span>
												&nbsp;&nbsp;&nbsp;&nbsp;
												累计学分 <span class="number bold"><cfif termCredit gt 0><cfoutput>#termCredit#</cfoutput><cfelse>-/-</cfif></span>
											</td>
										</tr>
									</cfif>
								</cfloop>
							</table>
						</cfloop>
						
					</cfif>
					
				</div>
				
				<div id="Common" class="tabContent">
				
					<div class="noticeBlock">
						<h3>全校通选课</h3>
						<hr/>
					</div>
					
					<cfif rs_common.recordCount eq 0>
						<div class="systemNotice">
							<h3><span class="img icon16x16 info"></span>尚无历史成绩</h3>
							<p>当前还没有的是 <em><cfoutput>#rs_student.stu_name#</cfoutput>(<cfoutput>#rs_student.stu_id#</cfoutput>)</em> 修读通选课的成绩信息.</p>
						</div>
					</cfif>
					
					<cfif rs_common.recordCount >
						
						<cfset markDone = 0 />
						
						<table class="UItable">
							<tr class="cellBorder">
								<td width="100">学期</td>
								<td>课程</td>
								<td align="center" width="80">课程号</td>
								<td align="center" width="40">学分</td>
								<td align="center" width="60">正考</td>
								<td align="center" width="60">补考</td>
							</tr>
							<cfloop query="rs_common">
								
								<cfif max( rs_common.mark_result, rs_common.mark_resit ) gte 60 >
									<cfset markDone = markDone + rs_common.course_credit />
								</cfif>
								
								<cfset finalResult = markAdvice.getMark( rs_common.mark_mode, rs_common.mark_result, rs_common.mark_note ) />
								<cfset resitResult = markAdvice.getMarkResit( rs_common.mark_mode, rs_common.mark_resit, rs_common.mark_renote, rs_common.mark_resit_limit ) />

								<tr class="cellBorder <cfif max(rs_common.mark_result, rs_common.mark_resit) lt 60>alertRow</cfif>">
									<td><span class="number bold"><cfoutput>#rs_common.academic_year#</cfoutput>-<cfoutput>#rs_common.academic_term#</cfoutput></span></td>
									<td><cfoutput>#rs_common.course_name#</cfoutput></td>
									<td align="center"><span class="number"><cfoutput>#rs_common.course_code#</cfoutput></span></td>
									<td align="center"><span class="number"><cfoutput>#numberFormat( rs_common.course_credit, "_._" )#</cfoutput></span></td>
									<cfif disableMark AND rs_common.term_id eq termId AND NOT arrayFind( complateCourseIds, rs_common.cid ) >
											<!--- 需要完成评教 才能看本学期成绩 --->
											<td colspan="2" align="center">请完成评教</td>
										<cfelse>
											<td align="center"><cfif isNumeric(finalResult)><span class="number"><cfoutput>#finalResult#</cfoutput></span><cfelse><cfoutput>#finalResult#</cfoutput></cfif></td>
											<td align="center"><cfif isNumeric(resitResult)><span class="number"><cfoutput>#resitResult#</cfoutput></span><cfelse><cfoutput>#resitResult#</cfoutput></cfif></td>
									</cfif>
								</tr>
							</cfloop>
							<tr class="cellBorder">
								<td colspan="6" align="right">已获得学分 <span class="number bold"><cfoutput>#numberFormat(markDone, "_.__")#</cfoutput></span></td>
							</tr>
						</table>
					
					</cfif>

				</div>
				
				<div id="Physical" class="tabContent">
					
					<div class="noticeBlock">
						<h3>体育项目成绩</h3>
						<hr/>
					</div>
					
					<cfif rs_physical.recordCount eq 0>
						<div class="systemNotice">
							<h3><span class="img icon16x16 info"></span>尚无历史成绩</h3>
							<p>当前还没有的是 <em><cfoutput>#rs_student.stu_name#</cfoutput>(<cfoutput>#rs_student.stu_id#</cfoutput>)</em> 修读体育项目的成绩信息.</p>
						</div>
					</cfif>
					
					<cfif rs_physical.recordCount >
						
						<cfset markDone = 0 />
						
						<table class="UItable">
							<tr class="cellBorder">
								<td width="120">学期</td>
								<td>课程</td>
								<td align="center" width="80">课程号</td>
								<td align="center" width="40">学分</td>
								<td align="center" width="60">正考</td>
								<td align="center" width="60">补考</td>
							</tr>
							<cfloop query="rs_physical">
								
								<cfif max( rs_physical.mark_result, rs_physical.mark_resit ) gte 60 >
									<cfset markDone = markDone + rs_physical.course_credit />
								</cfif>
								
								<cfset finalResult = markAdvice.getMark( rs_physical.mark_mode, rs_physical.mark_result, rs_physical.mark_note ) />
								<cfset resitResult = markAdvice.getMarkResit( rs_physical.mark_mode, rs_physical.mark_resit, rs_physical.mark_renote, rs_physical.mark_resit_limit ) />
								
								<tr class="cellBorder <cfif max(rs_physical.mark_result, rs_physical.mark_resit) lt 60>alertRow</cfif>">
									<td><span class="number bold"><cfoutput>#rs_common.academic_year#</cfoutput>-<cfoutput>#rs_common.academic_term#</cfoutput></span></td>
									<td><cfoutput>#rs_physical.course_name#</cfoutput></td>
									<td align="center"><span class="number"><cfoutput>#rs_physical.course_code#</cfoutput></span></td>
									<td align="center"><span class="number"><cfoutput>#numberFormat( rs_physical.course_credit, "_._" )#</cfoutput></span></td>
									<cfif disableMark AND rs_physical.term_id eq termId AND NOT arrayFind( complateCourseIds, rs_physical.cid ) >
											<!--- 需要完成评教 才能看本学期成绩 --->
											<td colspan="2" align="center">请完成评教</td>
										<cfelse>
											<td align="center"><cfif isNumeric(finalResult)><span class="number"><cfoutput>#finalResult#</cfoutput></span><cfelse><cfoutput>#finalResult#</cfoutput></cfif></td>
											<td align="center"><cfif isNumeric(resitResult)><span class="number"><cfoutput>#resitResult#</cfoutput></span><cfelse><cfoutput>#resitResult#</cfoutput></cfif></td>
									</cfif>
								</tr>
							</cfloop>
							<tr class="cellBorder">
								<td colspan="5" align="right">已获得学分 <span class="number bold"><cfoutput>#numberFormat(markDone, "_.__")#</cfoutput></span></td>
							</tr>
						</table>
					
					</cfif>
					
				</div>

				<div id="CET" class="tabContent">
				
					<div class="noticeBlock">
						<h3>四六级考试成绩记录</h3>
						<hr/>
					</div>
					
					<cfif rs_cet.recordCount eq 0 >
						<div class="systemNotice">
							<h3><span class="img icon16x16 info"></span>尚无历史成绩</h3>
							<p>当前还没有您的四六级考试成绩信息, 可能考试成绩尚未下发到学校 或 之前您没有报考.</p>
						</div>
					</cfif>
					
					<cfif rs_cet.recordCount >

						<table class="UItable">
							<tr class="cellBorder">
								<td width="180">准考证号</td>
								<td>考试场次</td>
								<td width="60">语言级别</td>
								<td align="center" width="40">总分</td>
								<td align="center" width="40">听力</td>
								<td align="center" width="40">阅读</td>
								<td align="center" width="40">写作</td>
								<td align="center" width="40">综合</td>
							</tr>
							<cfloop query="rs_cet">
								<tr class="cellBorder <cfif rs_cet.scroll lt 425>alertRow</cfif>">
									<td><span class="numeric"><cfoutput>#rs_cet.scroll_id#</cfoutput></span></td>
									<td>20<cfoutput>#mid(rs_cet.scroll_id, 7, 2)#</cfoutput>年 <cfif mid(rs_cet.scroll_id, 9, 1) eq "1">夏季<cfelse>冬季</cfif> 全国大学外语等级考试</td>
									<td><span class="numeric"><cfoutput>#rs_cet.exam_id#</cfoutput></span></td>
									<cfif rs_cet.absent eq "1">
											<td colspan="5" class="alertCell" align="center">缺考</td>
										<cfelse>
											<td align="center"><span class="numeric bold"><cfoutput>#rs_cet.scroll#</cfoutput></span></td>
											<td align="center"><span class="numeric"><cfoutput>#rs_cet.listening#</cfoutput></span></td>
											<td align="center"><span class="numeric"><cfoutput>#rs_cet.reading#</cfoutput></span></td>
											<td align="center"><span class="numeric"><cfoutput>#rs_cet.writing#</cfoutput></span></td>
											<td align="center"><span class="numeric"><cfoutput>#rs_cet.integration#</cfoutput></span></td>
									</cfif>
								</tr>
							</cfloop>
						</table>
						
					</cfif>
					
				</div>

			</div>
		</li>
	</ul>
</div>